package com.jmb.api.common.result;

import lombok.Getter;

@Getter
public enum ResultCodeEnum {
    SUCCESS(200, "成功"),
    FAIL(201, "失败"),
    PARAM_ERROR(202, "参数不正确"),
    SERVICE_ERROR(203, "服务异常"),
    DATA_ERROR(204, "数据异常"),
    ILLEGAL_REQUEST(205, "非法请求"),
    REPEAT_SUBMIT(206, "重复提交"),
    DELETE_ERROR(207, "请先删除子集"),
    EXIST_ERROR(208, "权限代码重复"),
    SQL_ERROR(209, "数据库连接失败"),
    Env_ERROR(210, "运行环境错误,请检查重试"),


    web_ACCOUNT_EXIST_ERROR(301, "账号已存在"),
    web_CAPTCHA_CODE_ERROR(302, "验证码错误"),
    web_CAPTCHA_CODE_EXPIRED(303, "验证码已过期"),
    web_CAPTCHA_CODE_NOT_FOUND(304, "未输入验"),
    web_LOGIN_AUTH(305, "未登陆"),
    web_ACCOUNT_NOT_EXIST_ERROR(306, "账号不存在"),
    web_ACCOUNT_ERROR(307, "用户名或密码错误"),
    web_ACCOUNT_DISABLED_ERROR(308, "该用户已被禁用"),
    web_ACCESS_FORBIDDEN(309, "无访问权限"),
    web_Project_EXIST_ERROR(310, "项目名称存在"),
    web_Module_EXIST_ERROR(311, "模块名称存在"),
    web_Db_EXIST_ERROR(312, "数据源名称存在"),
    getWeb_Db_Code_ERROR(313, "输入正确的调试环境"),
    web_Db_Disable(314, "数据源已禁用"),
    web_SQl_ERROR(315, "SQL脚本错误"),
    web_SQl_TYPE_ERROR(320, "SQL脚本类型错误"),
    web_Interface_EXIST_ERROR(316, "接口名称存在"),
    web_Interface_Disable(317, "接口已禁用"),
    web_Interface_url_ERROR(318, "url解析失败，参数为空或空"),
    web_Interface_url_not_null_ERROR(319, "url为空或空"),



    TOKEN_EXPIRED(601, "token过期"),
    TOKEN_INVALID(602, "token非法"),
    BODY_TYPE_ERROR(603, "bodyType参数错误"),
    MODULE_NOT_EXIST(604, "模块编号/项目编号不存在"),
    PRE_CASE_NOT_EXIST(605, "前置用例编号不存在"),
    PRE_CASE_NOT_SELF(606,"前置用例编号不能为自身" ),
    DEFAULT_VALUE_NOT_NULL_ERROR(607,"请填写缺省值" ),
    HAVE_DEFAULT_VALUE_ERROR(608,"haveDefaultValue参数值非法" ),
    CASE_NOT_EXIST(609, "用例编号不存在"),
    NAME_EXIST_ERROR(610, "名称已存在" );


    private final Integer code;

    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
